package com.longge;

public class RestoreString {

    public String restoreString(String s, int[] indices) {

        char[] chars = new char[indices.length];
        char[] strChars = s.toCharArray();
        for (int i = 0; i < indices.length; i++) {
            int index = indices[i];
            chars[indices[i]] = strChars[i];
        }
        return new String(chars);
    }

}
